<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    let hd = "afsknfdfsadf134143sglskgb70897"
    //一般情况找
    let num = [...hd].filter(a => !Number.isNaN(parseInt(a)))
    let nums = num.join("")
    console.log(nums)
    //正则表达式找
    console.log(hd.match(/\d/g).join(""))
</script>
</html>
